home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / Tools / Development / envCPP31 / compilers / stormc / rexx / run.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2002-01-01  |  2.5 KB  |  114 lines

  1. /* rexx macro */
  2.  
  3. options results                             /* enable return codes     */
  4.  
  5. if (left(address(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.  
  7.     address 'GOLDED.1'
  8.  
  9. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  10.  
  11. if (RC ~= 0) then
  12.  
  13.     exit
  14.  
  15. options failat 6                            /* ignore warnings         */
  16.  
  17. signal on syntax                            /* ensure clean exit       */
  18.  
  19. /* ------------------------- INSERT YOUR CODE HERE: -------------------- */
  20.  
  21. /* INPUT: COMMAND/K */
  22.  
  23. parse upper arg COMMAND .
  24.  
  25. 'QUERY CAT'
  26.  
  27. if (RESULT = "deutsch") then do
  28.  
  29.     STRING.sSTARTINGSHELL = "Starten der StormC-Shell..."
  30.     STRING.sSTORMSHELL    = "Kann die StormC-Shell nicht starten !"
  31.     STRING.sSTORMRUNERR   = "Kann die StormC-Laufzeitumgebung nicht|finden !"
  32.     STRING.sSTARTINGRUN   = "Laufzeitumgebung wird gestartet..."
  33. end
  34. else do
  35.  
  36.     STRING.sSTARTINGSHELL = "Starting StormC-Shell..."
  37.     STRING.sSTORMSHELL    = "Can not start the StormC shell !"
  38.     STRING.sSTORMRUNERR   = "Can not find the run-time environment !"
  39.     STRING.sSTARTINGRUN   = "Starting run-time environment..."
  40. end
  41.  
  42. call run_stormc
  43.  
  44. if (~show('P', 'STORMRUN')) then do
  45.  
  46.     'QUERY SCREEN VAR=SCREEN'
  47.  
  48.     'REQUEST STATUS="' || STRING.sSTARTINGRUN || '"'
  49.  
  50.     'RUN CMD="stormc:stormsys/stormrun golded pubscreen=*"' || SCREEN || '*"" ASYNC STACK=16384 WAITPORT="STORMRUN" SECONDS=10'
  51.  
  52.     'REQUEST STATUS=""'
  53.  
  54.     if (~show('P', 'STORMRUN')) then do
  55.  
  56.         'REQUEST PROBLEM="' || .sSTORMRUNERR || '"'
  57.  
  58.         'UNLOCK'
  59.  
  60.         exit
  61.     end
  62. end
  63.  
  64. if (COMMAND ~= "") then do
  65.  
  66.     options failat 25
  67.  
  68.     address 'STORMRUN' COMMAND
  69. end
  70.  
  71. /* ---------------------------- END OF YOUR CODE ----------------------- */
  72.  
  73. 'UNLOCK' /* VERY important: unlock GUI */
  74. EXIT
  75.  
  76. SYNTAX:
  77.  
  78. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  79. 'UNLOCK'
  80. EXIT
  81.  
  82. /* /// "run_stormc" */
  83.  
  84. run_stormc: procedure EXPOSE STRING.
  85.  
  86.     if (~show('P', 'STORMSHELL')) then do
  87.  
  88.         if (exists("stormc:stormsys/stormshell")) then do
  89.  
  90.             'REQUEST STATUS="' || STRING.sSTARTINGSHELL || '"'
  91.  
  92.             'QUERY PATH VAR=PATH'
  93.  
  94.             'QUERY SCREEN VAR=SCREEN'
  95.  
  96.             'RUN ASYNC CMD="stormc:stormsys/stormshell golded pubscreen=*"' || SCREEN || '*"" WAITPORT="STORMSHELL" SECONDS=10 STACK=16384 DIR="' || PATH || '"'
  97.  
  98.             'REQUEST STATUS=""'
  99.         end
  100.     end
  101.  
  102.     if (~show('P', 'STORMSHELL')) then do
  103.  
  104.         'REQUEST PROBLEM="' || STRING.sSTORMSHELL || '"'
  105.  
  106.         'UNLOCK'
  107.  
  108.         exit
  109.     end
  110.  
  111.     return
  112.  
  113. /* /// */
  114.